package com.cpx.service.impl;

import com.cpx.BaseMapper;
import com.cpx.service.BaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * @Auther: PanBin
 * @Date: 2018-8-14 15:02
 * @Description: 基础业务层实现类
 * @Version: 1.0
 */
public class BaseServiceImpl<T> implements BaseService<T> {

    @Autowired
    private BaseMapper<T> baseMapper;

    @Override
    public List<T> selectAll() {
        return baseMapper.selectAll();
    }

    @Override
    public List<T> select(@RequestBody T t) {
        return baseMapper.select(t);
    }

    @Override
    public int delete(@RequestBody T t) {
        return baseMapper.delete(t);
    }

    @Override
    public int deleteByPrimaryKey(@RequestBody Object o) {
        return baseMapper.deleteByPrimaryKey(o);
    }

    @Override
    public boolean existsWithPrimaryKey(@RequestBody Object o) {
        return baseMapper.existsWithPrimaryKey(o);
    }

    @Override
    public int insert(@RequestBody T t) {
        return baseMapper.insert(t);
    }

    @Override
    public int insertSelective(@RequestBody T t) {
        return baseMapper.insertSelective(t);
    }

    @Override
    public T selectByPrimaryKey(@RequestBody Object o) {
        return baseMapper.selectByPrimaryKey(o);
    }

    @Override
    public int selectCount(@RequestBody T t) {
        return baseMapper.selectCount(t);
    }

    @Override
    public T selectOne(@RequestBody T t) {
        return baseMapper.selectOne(t);
    }

    @Override
    public int updateByPrimaryKey(@RequestBody T t) {
        return baseMapper.updateByPrimaryKey(t);
    }

    @Override
    public int updateByPrimaryKeySelective(@RequestBody T t) {
        return baseMapper.updateByPrimaryKeySelective(t);
    }

    @Override
    public int insertList(@RequestBody List<T> list) {
        return baseMapper.insertList(list);
    }

    @Override
    public int insertUseGeneratedKeys(@RequestBody T t) {
        return baseMapper.insertUseGeneratedKeys(t);
    }
}
